package com.bao.student.controller;

import com.bao.student.entity.Student;
import com.bao.student.service.impl.StudentServiceImpl;

public class StudentController {
    public static StudentServiceImpl service=new StudentServiceImpl();
    static {
        service.students.add(new Student("0001","小明",15,"2024-7-17"));
        service.students.add(new Student("0002","中明",25,"2014-7-17"));
        service.students.add(new Student("0003","大明",45,"1994-7-17"));
        service.students.add(new Student("0004","老明",75,"1964-7-17"));
        service.students.add(new Student("0005","死明",95,"1944-7-17"));
    }
    public static void main(String[] args) {
        while (true) {
            System.out.println("--------欢迎来到学生管理系统--------");
            System.out.println("1 添加学生");
            System.out.println("2 删除学生");
            System.out.println("3 修改学生");
            System.out.println("4 查看学生");
            System.out.println("5 退出");
            System.out.println("请输入您的选择:");
            int i=StudentServiceImpl.INPUT.nextInt();
            switch (i) {
                case 1:
                    service.addStudent();
                    break;
                case 2:
                    service.deleteStudent();
                    break;
                case 3:
                    service.updateStudent();
                    break;
                case 4:
                    service.findAllStudent();
                    break;
                default:
                    System.err.println("退出系统");
                    return;
            }

        }
    }

}
